<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function addUser(){
            $.ajax({
                url: 'addUser',
                data: {
                    name: $('#name').val(),
                    pwd: $('#pwd').val(),
                    age: $('#age').val(),
                    sex: $('#male').prop('checked') ? 'male':'female',
                    height: $('#height').val(),
                    birthday: $('#birthday').val()
                },
                dataType: 'json',
                success: function(result){
                    console.log(result)
                }
            })
        }
    </script>
</head>
<body>
    <h2>添加用户</h2>
    <div>
        姓名：<input type="text" id="name"> <br>
        密码：<input type="password" id="pwd"> <br>
        年龄：<input type="text" id="age"> </br>
        性别：<input type="radio" name="sex" value="male" checked id="male">男
             <input type="radio" name="sex" value="female" id="female">女</input> <br>
        身高：<input type="text" id="height"> <br>
        出生日期：<input type="text" id="birthday"> </br>
        <input type="button" value="添加用户" onclick="addUser()">
    </div>
</body>
</html>